# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-unicorn
_pkgname=unicorn
pkgver=1.0.1
pkgrel=7
pkgdesc='Unicorn CPU emulator engine'
url='https://pypi.org/project/unicorn/#files'
arch=('x86_64' 'aarch64')
license=('BSD')
depends=('python2' 'unicorn')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('11dc4fb8e78bf508cff68ba60d3725eea4e9c2ccb56fca2f8ac2ba7e4ba40defb4a7b1a6c6afad260c2ebecee868b5a0d90fbd43f557f3f80a4131fed855e09c')

build() {
  cd "$_pkgname-$pkgver"

  UNICORN_QEMU_FLAGS="--python=/usr/bin/python2" python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

